/*
 * File:   multiboot.h
 * Author: D. Ryan Hild
 *
 * Created on May 24, 2010, 7:10 PM
 */

// See http://www.gnu.org/software/grub/manual/multiboot/multiboot.html
//
//Offset	Type	Field Name	Note
//0	u32	magic	required
//4	u32	flags	required
//8	u32	checksum	required
//12	u32	header_addr	if flags[16] is set
//16	u32	load_addr	if flags[16] is set
//20	u32	load_end_addr	if flags[16] is set
//24	u32	bss_end_addr	if flags[16] is set
//28	u32	entry_addr	if flags[16] is set
//32	u32	mode_type	if flags[2] is set
//36	u32	width	if flags[2] is set
//40	u32	height	if flags[2] is set
//44	u32	depth	if flags[2] is set

#define MULTIBOOT_MAGIC 0x1BADB002

#define MULTIBOOT_FLAG_ALIGN_MODULES 0x00000002
#define MULTIBOOT_FLAG_MEM_MAP       0x00000002
#define MULTIBOOT_FLAG_VIDEO         0x00000004
#define MULTIBOOT_FLAG_FORMAT_AOUT   0x00010000

#define MULTIBOOT_FLAGS (MULTIBOOT_FLAG_MEM_MAP | MULTIBOOT_FLAG_VIDEO)

#define MULTIBOOT_CHECKSUM (0 - MULTIBOOT_MAGIC - MULTIBOOT_FLAGS)

struct MagicHeader {
    unsigned int magic;
    unsigned int flags;
    unsigned int checksum;
    unsigned int header_addr;
    unsigned int load_addr;
    unsigned int load_end_addr;
    unsigned int bss_end_addr;
    unsigned int entry_addr;
    unsigned int mode_type;
    unsigned int width;
    unsigned int height;
    unsigned int depth;
} header = {
    MULTIBOOT_MAGIC, MULTIBOOT_FLAGS, MULTIBOOT_CHECKSUM, 0, 0, 0, 0, 0, 0x1, 0, 0, 0
};